/*
 * Filename:    AuditDispatchDao.java
 * Copyright:   2014 中国平安保险（集团）股份有限公司 版权所有
 * Company:     平安科技养老险及健康险系统开发部
 * Create at:   2014-11-11
 */
package com.paic.mhis.hcpms.audit.dao;

import java.util.List;

import org.springframework.stereotype.Component;

import com.paic.mhis.hcpms.audit.dto.AuditCaseDTO;
import com.paic.mhis.hcpms.audit.dto.AuditNotificationDTO;
import com.paic.mhis.hcpms.audit.dto.AuditProjectDTO;
import com.paic.pafa.biz.dao.BaseDAO;

@Component("auditProjectDao")
public class AuditProjectDao extends BaseDAO {

	public List<AuditProjectDTO> queryAuditProjectDTO(AuditProjectDTO bean) {

		List<AuditProjectDTO> list = (List<AuditProjectDTO>) this
				._queryForList("audticase.queryProjectList", bean);

		return list;

	}

	/**
	 * 删除稽核案件表信息
	 * 
	 * @param caseCode
	 */
	public void deleteAuditProject(String caseCode) {
		AuditProjectDTO bean = new AuditProjectDTO();
		bean.setCaseCode(caseCode);
		this._update("audticase.deleteAuditProject", bean);
	}

	/**
	 * 更新案件对象包含了更新人，更新日期，更新状态和是否删除
	 * 
	 * @param bean
	 */
	public void updateAuditCaseInfo(AuditCaseDTO bean) {

		this._update("audticase.updateCaseStatus", bean);
	}

	/**
	 * 根据案件编码加载对应的案件稽核信息
	 * 
	 * @param bean
	 * @return
	 */
	public AuditCaseDTO getAuditCaseDTOByProblemNo(AuditCaseDTO bean) {

		AuditCaseDTO auditCaseDTO = (AuditCaseDTO) this._getObject(
				"audticase.getCase", bean);
		return auditCaseDTO;
	}

	/**
	 * 根据案件编码修改对应的案件稽核信息
	 * 
	 * @param bean
	 * @return
	 */
	public void updateAuditCaseDTOByProblemNo(AuditCaseDTO bean) {
		this._update("audticase.updateCase", bean);
	}

	/**
	 * 根据案件编号获取稽核项目不合理费用总额
	 * 
	 * @param bean
	 * @return
	 */
	public String getDeductionAmmount(AuditProjectDTO bean) {
		String ammount = this._getString("audticase.getCaseDeductionAmmount",
				bean);
		return ammount;
	}

	/**
	 * 根据案件编号获取稽核项目总数
	 * 
	 * @param bean
	 * @return
	 */
	public int getCaseProjectCount(String caseCode) {
		int count = this._getInt("audticase.getCaseProjectCount", caseCode);
		return count;
	}

	/**
	 * 根据案件编号获取稽核项目
	 * 
	 * @param bean
	 * @return
	 */
	public List<AuditProjectDTO> getAuditProjectList(AuditProjectDTO bean) {
		List<AuditProjectDTO> list = (List<AuditProjectDTO>) this._list(
				"audticase.getProjectList", bean);
		return list;
	}

	/**
	 * 新增稽核项目
	 * 
	 * @param bean
	 * @return
	 */
	public void insertAuditProject(AuditProjectDTO bean) {
		this._insert("audticase.insertAuditProject", bean);
	}

	/**
	 * 删除稽核项目
	 * 
	 * @param bean
	 * @return
	 */
	public void updateAuditProject(AuditProjectDTO bean) {
		this._update("audticase.updateAuditProject", bean);
	}

	/**
	 * 根据案件编号获取稽核告知函是否存在
	 * 
	 * @param bean
	 * @return
	 */
	public Integer getAuditNotification(AuditCaseDTO bean) {
		int count = this._getInt("audticase.getAuditNotification", bean);
		return count;
	}

	/**
	 * 根据案件编号获取医疗机构相关信息
	 */
	public AuditNotificationDTO getAuditNotifications(AuditNotificationDTO bean) {
		AuditNotificationDTO auditNotificationDTO = new AuditNotificationDTO();
		auditNotificationDTO = (AuditNotificationDTO) this._getObject(
				"audticase.AuditNotificationDto", bean);
		return auditNotificationDTO;
	}
}
